<template>
	<view>
		<view class="" v-if="dayList.length">
			<uni-list-item class="list-item" :title="item.destination" :note="item.endtime" v-for="item in dayList" link :to="'./detail?data='+JSON.stringify(item)
			">
				<template slot="footer">
					<view class="" style="margin-top: 20rpx;">
						<text class="value" style="color: #54d2ff;">{{item.niNum}}</text>
						<text class="unit">{{item.punit}}</text>
					</view>
				</template>
			</uni-list-item>
		</view>
		<no-data v-else></no-data>
	</view>
</template>

<script>
	import _data from '../../../../common/_data.js'
	import _custom from '../../../../common/_custom.js'
	import NoData from '@/components/custom/no-data/no-data.vue'
	
	export default {
		components: {
			NoData
		},
		data() {
			return {
				dayList: [],
				day: '',
				carcode: '',
			}
		},
		onLoad(option) {
			let that = this;
			let data = JSON.parse(option.data)
			this.day = data.datetime
			this.carcode = data.myid
			uni.$on('wuni_day_list',function(data){
				if(data[0] && Object.keys(data[0]).length == 0) {
					that.dayList = []
					return
				}
				that.dayList = data
			});
			this.getDayList();
		},
		methods: {
			getDayList() {
				_custom.getDataJava({
					name: 'wuni_day_list',
					apiname: 'getWuNiCarDayList',
					apiparam: {
						//临时参数
						// obscode:'WUDI',
						obsdate: this.day,
						carcode: this.carcode
					}
				})
			},
		}
	}
</script>

<style>
	.list-item {
		padding: 0 30rpx;
	}
	
	.value {
		width: 120rpx;
		text-align: right;
		font-size: 32rpx;
		color: #48B1D9;
		font-weight: bold;
	}
	
	.unit {
		font-size: 20rpx;
		color: #aaa;
		margin-left: 10rpx;
	}
	
	.list-item /deep/ .uni-list-item__content-title {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
</style>
